from django.urls import path
from ...views.backand import users
from ...views.backand import apikeys
from ...views.backand import model
from ...views.backand import roles
from ...views.backand import users_handler
from ...views.backand import configs
from ...views.backand import menu_handler
from ...views.backand import product_handler
from ...views.backand import chats_handler
from ...views.backand import powerlog_handler
from ...views.backand import order_handler
from ...views.backand import importusers_handler
from ...views.backand import redeem_handler
from ...views.usergroup import usergroup_handler
from ...views.backand import upload_handler


urlpatterns = [
    path('login', users.login),
    path('logout', users.logout),
    path('session', users.session),

    # 基础配置
    path('config/get', configs.config_get),
    path('config/update', configs.config_update),

    # 后台dashboard
    path('dashboard/stats', users.dashboard_stats),

    # 管理员用户
    path('list', users.adminuser_list),
    path('save', users.save_user),
    path('enable', users.adminuser_enable),
    path('remove', users.adminuser_remove),
    path('resetPass', users.adminuser_resetpass),

    # apikey
    path('apikey/list', apikeys.api_keys_list),
    path('apikey/save', apikeys.api_keys_save),
    path('apikey/set', apikeys.api_keys_set),
    path('apikey/remove', apikeys.api_keys_remove),

    # model
    path('model/list', model.model_list),
    path('model/save', model.model_save),
    path('model/remove', model.model_remove),
    path('model/set', model.model_set),
    path('model/sort', model.model_sort),

    # role
    path('role/list', roles.roles_list),
    path('role/save', roles.roles_save),
    path('role/remove', roles.roles_remove),
    path('role/set', roles.roles_set),
    path('role/sort', roles.roles_sort),

    # users
    path('user/list', users_handler.users_list),
    path('user/save', users_handler.users_save),
    path('user/remove', users_handler.users_remove),
    path('user/resetPass', users_handler.users_resetpass),
    path('user/loginLog', users_handler.users_loginlog),

    # import users
    path('user/importslist', importusers_handler.importusers),

    # usergroup
    path('usergroup/list', usergroup_handler.usergroup_list),
    path('usergroup/save', usergroup_handler.usergroup_save),
    path('usergroup/remove', usergroup_handler.usergroup_remove),

    # 菜单管理
    path('menu/list', menu_handler.menu_list),
    path('menu/save', menu_handler.menu_save),
    path('menu/enable', menu_handler.menu_enable),
    path('menu/sort', menu_handler.menu_sort),
    path('menu/remove', menu_handler.menu_remove),

    # 充值产品
    path('product/list', product_handler.product_list),
    path('product/save', product_handler.product_save),
    path('product/enable', product_handler.product_enable),
    path('product/sort', product_handler.product_sort),
    path('product/remove', product_handler.product_remove),

    # 卡密管理
    path('redeem/list', redeem_handler.redeem_list),
    path('redeem/generate', redeem_handler.redeem_generate),
    path('redeem/enable', redeem_handler.redeem_enable),
    path('redeem/remove', redeem_handler.redeem_remove),
    path('redeem/export', redeem_handler.redeem_export),

    # 订单管理
    path('order/list', order_handler.order_list),
    path('order/remove', order_handler.order_remove),

    # 对话管理
    path('chat/list', chats_handler.chats_list),
    path('chat/history', chats_handler.chats_history),
    path('chat/remove', chats_handler.chats_remove),
    path('chat/message', chats_handler.chats_message),
    path('chat/message/remove', chats_handler.chats_message_remove),

    # 算力日志
    path('powerLog/list', powerlog_handler.powerlog_list),

    # 公告上传文件以及图片
    path('upload', upload_handler.upload_file),
]